package appReate.Net;

import android.app.Activity;
import android.content.Context;
import android.net.ConnectivityManager;

public class ConnectNet {
	public static boolean isOnline(Activity activity) {
	    ConnectivityManager cm = (ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE);
	    // test for connection
	    if (cm.getActiveNetworkInfo() != null
	            && cm.getActiveNetworkInfo().isAvailable()
	            && cm.getActiveNetworkInfo().isConnected()) {
	        return true;
	    } else {
	        //Log.v("TAG", "Internet Connection Not Present");
	        return false;
	
	}
}
}
